
Initiate a properties change on the specified host.
| URL Parameters | |
|---|---|
| format | The format of the data in the request body. Can be
json or xml. If present, the format parameter
overrides the request Content-type header. |
Upon success, MarkLogic Server returns a status code 204 (No Content) or a status code 202 (Accepted). If the payload is malformed or the host does not exist, a status code of 400 (Bad Request) is returned. A status code of 401 (Unauthorized) is returned if the user does not have the necessary privileges.
manage-admin role, or the following
privilege: http://marklogic.com/xdmp/privileges/manage-admin
http://marklogic.com/xdmp/privileges/manage
http://marklogic.com/xdmp/privileges/admin/host
The data in the request body can contain one or more properties to modify. Set
bootstrap-host to true if it is to serve as the bootstrap host
for the cluster; otherwise set to false. For details on the bootstrap host, see
Database Replication in MarkLogic Server in the Database Replication Guide.
The data in the request body has the following structure:
dynamic-hosthost-namegroupbind-portforeign-bind-portzonebootstrap-hosthost-modehost-mode-description
$ cat host-prop.xml
==>
<host-properties xmlns="http://marklogic.com/manage">
<zone>my-new-zone</zone>
</host-properties>
$ curl --anyauth --user user:password -X PUT -d @./host-prop.xml \
-i -H "Content-type: application/xml" \
http://localhost:8002/manage/v2/hosts/my-host/properties
==> The zone property of host my-host is modified. MarkLogic Server
returns headers similar to the following:
HTTP/1.1 204 No Content
Server: MarkLogic
Content-Length: 0
Connection: Keep-Alive
Keep-Alive: timeout=5
$ cat host-prop.json
==>
{ "zone":"my-new-zone" }
$ curl --anyauth --user user:password -X PUT -d @./host-prop.json \
-i -H "Content-type: application/json" \
http://localhost:8002/manage/v2/hosts/my-host/properties
==> The zone property of host my-host is modified. MarkLogic Server
returns headers similar to the following:
HTTP/1.1 204 No Content
Server: MarkLogic
Content-Length: 0
Connection: Keep-Alive
Keep-Alive: timeout=5
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.